<!--Gordana Pejic 191/01-->
<?php
    require '../../pages/db.php';
    $con=  dbConnect("sib");

$chck="SELECT * FROM user WHERE UserName='$_POST[username]'";
$result=mysql_query($chck, $con);

if (mysql_num_rows($result) >= 1)
    {  $row=mysql_fetch_array($result);
        if ($row['Password']!=$_POST["password"] || $row['Access']!=10){
        header("Location: ../index.php?err=5");
       }
        else  {
            session_start();
            $_SESSION['admin'] = $usern;
            header("Location: ../index-admin.php");
        }
    }
else {
     header("Location: ../index.php?err=1");
}
    mysql_close($con);
?>
